/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.ugent.medirem.logic;

import be.ugent.medirem.persistence.entity.details.MedicationTaskDetails;
import be.ugent.medirem.persistence.entity.values.MedicationTaskValues;
import be.ugent.medirem.persistence.exception.EntityNotFoundException;
import be.ugent.medirem.persistence.util.TaskStatus;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.ejb.Remote;

/**
 *
 * @author Thomas Roelens
 */
@Remote
public interface TaskRemote {

    @RolesAllowed({"gp", "patient"})
    Long createTask(MedicationTaskValues details) throws IllegalArgumentException;

    @RolesAllowed("gp")
    void removeTask(Long taskId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    void updateTask(Long taskId, MedicationTaskValues details) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    void updateTaskStatus(Long taskId, Long patientId, TaskStatus status) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    MedicationTaskDetails getTaskDetails(Long taskId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    List<String> getAllTaskStatus();

    @RolesAllowed({"gp", "patient"})
    List<MedicationTaskDetails> getAllTasks(Long patientId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    List<MedicationTaskDetails> getAllCompletedTasks(Long patientId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    List<MedicationTaskDetails> getAllIncompletedTasks(Long patientId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    List<MedicationTaskDetails> getMissedTasks(Long patientId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    MedicationTaskDetails getNextTask(Long patientId, Long prescriptionId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed("gp")
    List<MedicationTaskDetails> getTasks(Long patientId, Long prescriptionId) throws IllegalArgumentException, EntityNotFoundException;

    @RolesAllowed({"gp", "patient"})
    List<MedicationTaskDetails> getAllUnseenTasks(Long patient);
}
